package com.jin.spirng_boot_learn.untils;

import org.junit.Assert;
import org.springframework.core.convert.support.DefaultConversionService;

import java.beans.PropertyEditor;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Set;

public class LearnDefaultConversionService {


    public static void main(String[] args) {

        String[] init = {"One", "Two", "Three", "One", "Two", "Three"};


        DefaultConversionService service = new DefaultConversionService();
        // 指定转换的能力
        service.canConvert(String.class, Boolean.class);
        service.canConvert(String.class, Integer.class);
        // 转换示例
        Boolean a = service.convert("true", Boolean.class);
        Integer b = service.convert("123", Integer.class);
        Boolean c = service.convert("0", Boolean.class);

        // create two lists
        List list1 = new ArrayList(Arrays.asList(init));
        List list2 = new ArrayList(Arrays.asList(init));
        List list3 = new ArrayList(Arrays.asList(init));

        // remove from list1
        list1.remove("One");
        System.out.println("List1 value: " + list1);


    }
}
